#! /bin/bash
#one bin/bash to impl function about files differident
#impl file change tell to me
echo "input source file name"
read file
cp -rf $file source       
sleep 90            
while [ -f $file ]     
do
nu=`diff source $file`
if [ -z $nu ];then
echo "file content is not change !"
else
echo "file content is change,go to look it right now?"
read see_it
case $see_it in
y|Y|ye|Ye|yes|Yes)
cat $file
diff $file source
;;
n|N|no|No)echo "file content is change,you are not see it !"
;;
Esac
fi
ls1=`stat -c %X source`
ls2=`stat -c %X $file`
if [ $ls1 = $ls2 ];then
echo "atime value was not chganged !"
else
echo "atime value was changed !"
echo "source:atime is $ls1 ;$file:atime is $ls2 !"
Fi
ls3=`stat -c %Y source`
ls4=`stat -c %Y $file`
if [ $ls3 = $ls4 ];then
echo "mtime value is not changed !"
else
echo "mtime value is changged !"
echo "source:mtine is $ls3 ;$file:mtime is $ls4 !"
Fi
ls5=`stat -c %Z source`
ls6=`stat -c %Z $file`
if [ $ls5 = $ls6 ];then
echo "ctime is not changed !"
else
echo "ctime is changed !"
echo "source:ctime is $ls5 ;$file:ctime is $ls6 !"
Fi
ls7=`stat -c %a source`
ls8=`stat -c %a $file`
if [ $ls7 = $ls8 ];then
echo "limit value is not changed !"
else
echo "limit value is changed !"
echo "source:limit is $ls7 ;$file:limit is $ls8 !"
Fi
echo "go on or not !"
read flag
case $flag in
y|Y|ye|Ye|yes|Yes)
echo "input source file name"
read file
cp -rf $file source
sleep 90
;;
n|N|no|No)
echo "thanks to user it !"
break
;;
esac
done
rm -rf source
exit 0

